package com.ranjiaqi.builder;

/**
 * @ClassName TestSetCharAt
 * @Description TODO
 * @Author hp
 * @Date 2021/6/21 18:15
 * @Version 1.0
 **/
public class TestSetCharAt {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("abcdef");
/*
        setCharAt()用来修改指定索引位置的元素
        有两个参数index是指定索引的位置
        ch是传递一个char型的字符
*/
        stringBuilder.setCharAt(2,'C');
        System.out.println("stringBuilder = " + stringBuilder);
    }
}
